<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('wechat_configs', function (Blueprint $table) {
            $table->id();
            $table->string('app_id')->nullable()->comment('应用ID');
            $table->string('secret')->nullable()->comment('应用密钥');
            $table->string('token')->nullable()->comment('令牌');
            $table->string('aes_key')->nullable()->comment('AES密钥');
            $table->string('app_callback_url')->nullable()->comment('应用回调URL');
            $table->boolean('use_stable_access_token')->default(false)->comment('是否使用稳定的访问令牌');
            $table->timestamps();
            $table->comment('微信公众号配置表');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('wechat_configs');
    }
};
